package cc.autoapi.pucong.auto.flow.core.flow.execNode.exec.handler;

import cc.autoapi.pucong.auto.flow.core.flow.execNode.entity.log.LogNodeHandlerMsgDto;
import cc.autoapi.pucong.auto.flow.core.flow.execNode.eventBus.ISubscriberAbstract;
import cc.autoapi.pucong.auto.flow.core.flow.execNode.selfenum.MsgTypeEnum;
import lombok.extern.slf4j.Slf4j;

/**
 * 日志处理器
 */
@Slf4j
public class ProcessExecLogHandler extends ISubscriberAbstract<LogNodeHandlerMsgDto> {

    public ProcessExecLogHandler() {
        super();
    }

    @Override
    public Integer getIndexSort() {
        return 0;
    }

    @Override
    public String getMessageType() {
        return MsgTypeEnum.LOG_MSG.getType();
    }

    @Override
    public void receiveMessage(LogNodeHandlerMsgDto message) {
        log.info(String.format("api日志，实例id：{}，日志内容：{}", message.getInstanceId(), message.getLogContent()));
    }
}
